<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with create a library - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=create+a+library</link>
      <pubDate>Sun, 08 Aug 2021 19:39:48 +0000</pubDate>
         <description>Tagged with create a library - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedcreate+a+library/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Issue with the Constructor in own JAVA based Libraries</title>
      <link>https://forum.processing.org/two/discussion/25351/issue-with-the-constructor-in-own-java-based-libraries</link>
      <pubDate>Sun, 03 Dec 2017 10:25:31 +0000</pubDate>
      <dc:creator>f41ardu</dc:creator>
      <guid isPermaLink="false">25351@/two/discussions</guid>
      <description><![CDATA[<p>Successfully managed the library template 3.0,2 integration into Eclipse (Win 8.1). 
Managed to build the example.</p>

<p>But I run in trouble while creating a library on my own.<br />
This "The constructor MYClass(....) is undefined message" issue.</p>

<p>What have to be considered while creating the MyClass.java file. I used the HelloLibrary.java to start with.</p>

<p>As a workaround I again start with the example and step by step I remove code and add my own code (after renaming the necessary parts in the entire template). This seems to be OK, but I did on the first approach, too.</p>

<p>Are there better examples simple enough to get an understanding but with more comples Constructors? 
Or what is the prerequesite for a well defined Constructor taking more arguments in a class file?</p>

<p>F41</p>
]]></description>
   </item>
   <item>
      <title>How to compile a Processing library for distribution which depends on processing.serial ?</title>
      <link>https://forum.processing.org/two/discussion/14041/how-to-compile-a-processing-library-for-distribution-which-depends-on-processing-serial</link>
      <pubDate>Thu, 17 Dec 2015 11:32:31 +0000</pubDate>
      <dc:creator>orgicus</dc:creator>
      <guid isPermaLink="false">14041@/two/discussions</guid>
      <description><![CDATA[<p>Hi,</p>

<p>I'm trying to put together a basic library and followed the <a rel="nofollow" href="https://github.com/processing/processing/wiki/Library-Basics">instructions on github</a>, but ran into some issues.</p>

<p>I'm using Option B (the downloaded package) of the <a rel="nofollow" href="https://github.com/processing/processing-library-template">processing-library-template</a>. Importing the zip didn't work, perhaps a bug with the eclipse version I'm using ? (Luna Service Release 1 (4.4.1) Build id: 20140925-1800 on OSX 10.10.5)
I have copied the folders contained in the zip, maintaining the original src folder from the Java project.</p>

<p>The issue I'm having is with compilation and library dependencies.
I'm using the core and serial libraries. This are the options I've tried:</p>

<p><strong>Adding external projects</strong> : imported the processing-core and processing-serial eclipse projects from the github repo.</p>

<p><img src="http://lifesine.eu/so/p5l_1_adding_projects.png" alt="" /></p>

<p>This method allows me to test within eclipse, but the ant build fails (it doesn't seem to 'see' the projects)</p>

<p><strong>Copying libraries to the eclipse project</strong>: copied jar file for the libraries used Core (core.jar) and Serial(jssc.jar and serial.jar + JNI libs) to the eclipse project.</p>

<p><img src="http://lifesine.eu/so/p5l_copying_libraries_1.png" alt="" /></p>

<p>This works to certain degree: the library compiles and the examples compile in Processing, but whenever I try to import processing.serial.* in any other Processing sketch, I get a dialog about a serial being a duplicate library (because the jar files copied to the eclipse projects get copied to the Processing library folder. If I manually remove these jars, I get a class not found error:</p>

<p><code>java.lang.NoClassDefFoundError: processing/serial/Serial</code></p>

<p><strong>Adding external jars</strong>: I've added the external jar files from the Processing.app folder</p>

<p><img src="http://lifesine.eu/so/p5l_external_jars_build.png" alt="" /></p>

<p>Reading the <em>Adding core.jar and other .jar files to your classpath</em> section of the <a rel="nofollow" href="https://github.com/processing/processing-library-template">processing-library-template</a> had this section which I might have been missing before:</p>

<blockquote class="Quote">
  <p>Adjust the build.xml file accordingly.</p>
</blockquote>

<p>It doesn't say how to adjust the build.xml file though (and the links in that section still point to the Google Code pages).</p>

<p>My attempt do adjust build.xml goes like this:</p>

<ol>
<li>In build.properties I've added <code>classpath.serial.location=/Applications/Processing.app/Contents/Java/modes/java/libraries/serial/library</code></li>
<li>In build.xml I've used this path:
<code>&lt;path id="classpath"&gt;
    &lt;fileset dir="${classpath.local.location}" includes="${classpath.local.include}" /&gt;
    &lt;fileset dir="${classpath.serial.location}" includes="**/*.jar" /&gt;
    &lt;fileset dir="${classpath.libraries.location}" includes="**/*.jar" /&gt;
    &lt;fileset dir="${project.lib}" includes="**/*.jar" /&gt;
&lt;/path&gt;</code></li>
</ol>

<p>Running ant mentions the build is successful, but I see some javadoc errors:
<code>package processing.serial does not exist
  [javadoc] import processing.serial.Serial;
  [javadoc]                         ^
cannot find symbol
  [javadoc] symbol  : class Serial</code>
The bigger issue is I get the same class not found error when trying to compile the library examples in Processing:
<code>java.lang.NoClassDefFoundError: processing/serial/Serial</code></p>

<p>If I manually add the serial import to the example (<code>import processing.serial.Serial;</code>) the code runs, but I'm guessing
this shouldn't be necessary if the class in my library is already importing this ?</p>

<p>In short: I don't think I'm using the processing-library-template setup correctly and I'm confused to what the best practices are for compiling and distributing a library that has a dependency (serial library in this case).</p>

<p>How do I correctly build my own Processing library with it's dependency ?</p>

<p>Thank you,
George</p>
]]></description>
   </item>
   </channel>
</rss>